package com.acwing.lc.part1;

/**
 * @author rkc
 * @date 2022/9/16 9:59
 */
public class LC55跳跃游戏 {

    public boolean canJump(int[] nums) {
        for (int i = 0, j = 0; i < nums.length; i++) {
            if (j < i) return false;
            j = Math.max(j, i + nums[i]);
        }
        return true;
    }
}
